package com.feicheng.lanniao.controller;

import java.time.LocalDateTime;

import org.aspectj.weaver.patterns.ThisOrTargetAnnotationPointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.feicheng.lanniao.entity.HouseSellClientVo;

import com.feicheng.lanniao.result.ResultInfo;
import com.feicheng.lanniao.service.IHouseSellClientVoService;

/**
 * <p>
 * VIEW 前端控制器
 * </p>
 *
 * @author feichengTech
 * @since 2021-09-07
 */
@RestController
@RequestMapping("/lanniao-admin/house-sell-client-vo")
public class HouseSellClientVoController {

	@Autowired
	private IHouseSellClientVoService iHouseSellClientVoService;

	/**
	 * 卖房列表查询
	 * @param des 房子描述
	 * @param provienceId 省
	 * @param cityId 市
	 * @param reignId 区
	 * @param clientId 用户id
	 * @param sellId 卖房id
	 * @param typeName 产权表中的产权名字
	 * @param houseAreaId 面积区间表id
	 * @param sellPriceId 价格区间表id
	 * @param currentPage 当前页
	 * @param pageSize 每页多少条
	 * @return 卖房列表集合
	 */
	@GetMapping("/page")
	public ResultInfo getList(
			String des,Integer provienceId,
			Integer cityId, Integer reignId,
			Integer clientId, Integer sellId,
			String typeName, Integer houseAreaId, Integer sellPriceId,
			String tel,
			String wxNumber,
			String louceng,
			String xiaoqu,
			String pianqu,
			String chaoxiang,
			String zhuangxiu,
			Integer dianti,
			String niandai,
			Integer roomCount,
			@RequestParam(defaultValue = "1") int currentPage, @RequestParam(defaultValue = "10") Integer pageSize) {
		return iHouseSellClientVoService.getList(des, provienceId, cityId,
				reignId, clientId, sellId, typeName, houseAreaId, sellPriceId, tel,wxNumber,
				louceng,xiaoqu,pianqu,chaoxiang,zhuangxiu,dianti,niandai,roomCount,currentPage, pageSize);
	}
	/**
	 * 查询卖房详情
	 * @param sellId 卖房id
	 * @return 返回卖房详情
	 */
	@GetMapping("/info")
	public ResultInfo info(Integer sellId) {
		return ResultInfo.success(iHouseSellClientVoService.getById(sellId));
	}

}
